package com.sunday.common.netty.e8_Handlerorder.client;

import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class HandlerOrderTcpClientHandler extends SimpleChannelInboundHandler<String> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        log.info("Get message from server: {}", msg);
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        log.info("Client Channel active");
//        ctx.writeAndFlush(Unpooled.copiedBuffer("Hello, Udp server. This is Udp client.", CharsetUtil.UTF_8));
    }


}